from django.contrib import admin

# Register your models here.
from echart.models import  DataItem, Chart, ItemClass, FwNewsPowerClass, AiImgModel


class DataItemAdmin(admin.ModelAdmin):
    list_display = ('name', 'value', 'item_date')


class ChartAdmin(admin.ModelAdmin):
    list_display = ('title','is_activte', 'created')

class ItemClassAdmin(admin.ModelAdmin):
    list_display = ('name', 'color')

@admin.register(FwNewsPowerClass)
class FwNewsAdmin(admin.ModelAdmin):
    def username(self):
        return self.user.username

    list_display = ('name', 'power', username, 'created')

admin.site.register(DataItem, DataItemAdmin)
admin.site.register(ItemClass, ItemClassAdmin)
admin.site.register(Chart, ChartAdmin)


@admin.register(AiImgModel)
class AiAdmin(admin.ModelAdmin):
    list_display = ('project', 'predict', 'is_correct', 'fix_name')